home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
bbs
/
cuser125.zip
/
CUCHECK2.MEX
< prev
next >
Wrap
Text File
|
1997-07-12
|
6KB
|
234 lines
//////////////////////////////////////////////////////////////////////////////
// //
// CoolUser V1.25 (C)1996-1997 Neil Staib - Checked Part 2 //
// //
// MEX: Copywrite 1990, 1995 by Lanius Corporation. All Rights reserved. //
// //
//////////////////////////////////////////////////////////////////////////////
#include <max.mh>
#define INCL_global
#define INCL_cooluser
#include <language.mh>
#include <cooluser.mh>
#define MAX_LINES 250
void main()
{
int: counter, count, sbname, cool, iname, eof, badtry, line;
char: nonstop,inkey;
struct _usr: newusr;
string: pwd2, password, fname, lname;
array [1..MAX_LINES] of string: badpass;
nonstop:=0;
badtry:=0;
init_lang_cooluser();
log(":COOLUSER: "+ str_st_log_password);
getpassword:
pageheader();
print(str_st_header, str_st_pass_name, "\n");
print(str_st_text, "\n", str_st_pass_prompt, ": ");
password:="";
counter:=1;
inkey:=getch();
while(inkey<>13) // do this until we get <Enter>
{
if(inkey=8) // if we got a <Backspace>
{
if(counter>1)
{
print("\b \b");
counter:=counter-1;
password:=substr(password,1,strlen(password)-1);
}
else
password:="";
}
else if(counter <=15)
{
print("*");
password[counter]:=inkey;
counter:=counter+1;
}
else
{
password:="";
}
inkey:=getch();
}
if(strlen(password)=0)
{
writefile("cucheck.3"); // Display Main Menu
return;
}
if(strlower(password) <> strlower(usr.pwd))
{
badtry:=badtry+1;
if(badtry=4)
{
print(str_st_error, "\n", str_st_pass_badtry);
sleep(200);
display_file(str_st_dir_txt + "hangup", nonstop);
}
else
{
print(str_st_error, "\n", str_st_text, str_st_pass_incorrect, "\n");
sleep(100);
goto getpassword;
}
}
print(str_st_text, "\n", str_st_pass_new, ": ");
password:="";
counter:=1;
inkey:=getch();
while(inkey<>13) // do this until we get <Enter>
{
if(inkey=8) // if we got a <Backspace>
{
if(counter>1)
{
print("\b \b");
counter:=counter-1;
password:=substr(password,1,strlen(password)-1);
}
else
password:="";
}
else if(counter <=15)
{
print("*");
password[counter]:=inkey;
counter:=counter+1;
}
else
{
password:="";
}
inkey:=getch();
}
print('\n');
if(password="" or strfind(password," "))
{
print("\n", str_st_pass_bad,"\n\n");
goto getpassword;
}
if((strlen(password)<4))
{
print("\n", str_st_pass_less4, "\n\n");
goto getpassword;
}
if((strlen(password)>15))
{
print("\n", str_st_pass_more15, "\n\n");
goto getpassword;
}
if(password = fname)
{
log(":" + str_st_log_passwordbad + password + "'");
print(str_st_error, "\n", str_st_text, str_st_pass_incorrect, "\n");
goto getpassword;
}
if(password = lname)
{
log(":" + str_st_log_passwordbad + password + "'");
print(str_st_error, "\n", str_st_text, str_st_pass_incorrect, "\n");
goto getpassword;
}
if(password = fname+lname)
{
log(":" + str_st_log_passwordbad + password + "'");
print(str_st_error, "\n", str_st_text, str_st_pass_incorrect, "\n");
goto getpassword;
}
// Check Password
iname := 1;
badpass[cool]:= "";
eof:=0;
iname := open("d:\\bbs\\max\\pwdtrash.bbs", IOPEN_READ); // Scan for Bad password
for(cool:=1;cool<MAX_LINES;cool:=cool+1)
{
eof := readln(iname, badpass[cool]);
if (eof = -1)
{
close(iname);
goto getpassword2;
}
else
{
if (strlower(password) = strlower(badpass[cool]))
{
log(":" + str_st_log_passwordbad + password + "'");
print(str_st_error, "\n", str_st_text, str_st_pass_incorrect, "\n");
close(iname);
goto getpassword;
}
}
}
getpassword2:
print(str_st_pass_ver);
pwd2:="";
counter:=1;
inkey:=getch();
while(inkey<>13) // do this until we get <Enter>
{
if(inkey=8) // if we got a <Backspace>
{
if(counter>1)
{
print("\b \b");
counter:=counter-1;
pwd2:=substr(pwd2,1,strlen(pwd2)-1);
}
else
pwd2:="";
}
else if(inkey=0) // if we got a NULL
{
inkey:=getch();
}
else
{
print("*");
pwd2[counter]:=inkey;
counter:=counter+1;
}
inkey:=getch();
}
print('\n');
if(strlower(password)<>strlower(pwd2))
{
count:=1;
print("\n", str_st_pass_match, "\n");
goto getpassword;
}
newusr.pwd:=password;
return;
}